package com.huluobo.a2308douyindemo.mine

import androidx.lifecycle.MutableLiveData
import com.huluobo.a2308douyindemo.bean.VideoBean
import com.huluobo.a2308douyindemo.db.DouYinDatabase
import com.huluobo.a2308douyindemo.mvvm.BaseViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

/**
 *  Created by LC on 2025/10/28.
 */
@HiltViewModel
class MineVewModel @Inject constructor(val db: DouYinDatabase) : BaseViewModel() {

    val queryCollectVideosSuccess by lazy { MutableLiveData<List<VideoBean>>() }
    fun queryCollectVideos() {
        executeDb(
            { db.getVideoDao().queryVideoInfo() },
            queryCollectVideosSuccess::postValue
        )
    }
}